package com.xm.servlet.background.commodity;

import com.xm.service.background.CommodityInsuranceService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 康文程
 * @date 2024-1-18 下午 06:43
 */
@WebServlet("/background/delete/commodity/insurance")
public class DeleteCommodityInsuranceByCommodityIdAndInsuranceId extends HttpServlet {
    private final CommodityInsuranceService service = new CommodityInsuranceService();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String commodityId = req.getParameter("commodityId");
        String insuranceId = req.getParameter("insuranceId");
        resp.getWriter().print(service.
                deleteCommodityInsuranceByCommodityIdAndInsuranceId(
                        Integer.parseInt(commodityId), Integer.parseInt(insuranceId)));
    }
}
